package com.xc.freeapp.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xc.freeapp.dao.LeadPageDao;
import com.xc.freeapp.dao.dataSource.DBContextHolder;
import com.xc.freeapp.entity.LeadPage;
import com.xc.freeapp.exception.BaseException;
import com.xc.freeapp.service.LeadPageService;
import com.xc.freeapp.util.Constant;
import com.xc.freeapp.util.PropertiesUtil;
@Service
public class LeadPageServiceImpl implements LeadPageService {
	@Autowired
	private LeadPageDao leadPageDao;

	public List<LeadPage> getLeadPage(int business, String vesion) throws BaseException{
		DBContextHolder.switchDataSourceRW();//切换数据源
		List<LeadPage> list=new ArrayList<LeadPage>();
		try {
			list = leadPageDao.selectByBusinessId(business,vesion);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			throw new BaseException(Constant.COMMON_ERROR);
		}
		return list;
	}

}
